/**
 * 
 */
package info.niwota.vi;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

/**
 * @author qiangli
 * 
 */
public final class Preferences {
	private static final String LAST_URI = "last.uri";

	/**
	 * 
	 */
	private Preferences() {
	}

	public static String getLastUri(Context ctx) {
		try {
			final SharedPreferences p = PreferenceManager
					.getDefaultSharedPreferences(ctx);
			return p.getString(LAST_URI, null);
		} catch (Exception e) {
		}
		return null;
	}

	public static void putLastUri(Context ctx, String uri) {
		try {
			final SharedPreferences p = PreferenceManager
					.getDefaultSharedPreferences(ctx);
			p.edit().putString(LAST_URI, uri).commit();
		} catch (Exception e) {
		}
	}
}
